<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="css/common.css" type="text/css" />

<link href="css/adminstyle.css" rel="stylesheet" type="text/css">
<link href="js/uploadify/uploadify.css" rel="stylesheet" type="text/css">
<title>管理区域</title>
<script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
<link href="css/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"></script>
<script language="javascript" type="text/javascript" src="js/uploadify/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="js/uploadify/jquery.uploadify.v2.1.4.min.js"></script>

</head>

<body>
<div id="man_zone">
<div style="background-color:#FFFFFF ">

 <form  method="post" action="<? if  (empty($id)){ echo  'Chapter_subAdd.html'; }else{ echo  'Chapter_subUpdate.html'; }  ?>" ><input name="id" type="hidden" value="<?=$id?>">

  <table width="98%" border="0" align="center"  cellpadding="3" cellspacing="1" class="tableborder">

    <tr>

      <td width="10%" class="left_title_2adminssd">章节标题</td>

      <td width="27%" bgcolor="#FFFFFF"><input type="text" name="name"  value="<?=getStr($extract_vars,'name')?>" size="80" /></td>

      <td width="11%" class="left_title_2adminssd">章节简介</td>

      <td width="52%" bgcolor="#FFFFFF"><textarea name="content" id="textarea" cols="80" rows="10"><?=getStr($extract_vars,'content')?></textarea></td>

      </tr>

    <tr>

      <td class="left_title_2adminssd">章节标题(英语)</td>

      <td bgcolor="#FFFFFF"><input type="text" name="english_name"  value="<?=getStr($extract_vars,'english_name')?>" size="80" /></td>

      <td class="left_title_2adminssd">章节标题内容(英语)</td>

      <td bgcolor="#FFFFFF"><textarea name="english_content" id="textarea" cols="80" rows="10"><?=getStr($extract_vars,'english_content')?></textarea></td>

      </tr>

      <tr>

      <td class="left_title_2adminssd">所属教材</td>

      <td bgcolor="#FFFFFF"><select name="course_id" >

      <?=$courseOption?>

      </select></td>

      <td class="left_title_2adminssd">章节</td>

      <td bgcolor="#FFFFFF">第<input name="chater_no" type="text" id="textarea" value="<?=getStr($extract_vars,'chater_no')?>" />节</td>

      </tr>

        <tr>

      <td class="left_title_2adminssd">状态</td>

      <td bgcolor="#FFFFFF"><select name="status" >

      <?=$statusOption?>

      </select></td>

      <td class="left_title_2adminssd">文档</td>
 	  <td colspan="3" bgcolor="#FFFFFF">
	      <?php $display_style='none'; $upload_value="";?>
	      <?if(getStr($extract_vars,'document')!=""){?>
		  		<?  $display_style='inline-block';?>
		  		<?  $upload_value=htmlspecialchars(getStr($extract_vars,'document'));?>
	      <?}?>
	      <input id="file_upload_document" name="file_upload_document" class="file_upload" type="file" multiple="true">
	      <br>
	      <a href="javaScript:void(0);" class="del_file" style="display:<?=$display_style?>">&nbsp;&nbsp;&nbsp;&nbsp;删除附件</a>
	      <a class="file_link" href="../<?=$upload_value?>" target="_blank" style="display:<?=$display_style?>"/>查看</a>
	      <input type="hidden" class="file_src" name="document" value="<?=$upload_value?>" id="document" >	                
      </td>
      </tr>
        <tr  bgcolor="#FFFFFF">
      <td colspan="4">&nbsp;</td>

      </tr>      

    <tr  bgcolor="#FFFFFF">

      <td colspan="12" align="center" >

      <input name="" type="button" class="PublicBot" value="返回" onclick="javaScript:location.href='chapter_lists.html'" />

      &nbsp;&nbsp;&nbsp;

        <input class="PublicBot" name="" type="submit" value="提交" />      </td>

    </tr>

  </table>

  </form>

</div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
		$(function() {
			$('.file_upload').uploadify({
		        'uploader'  : 'js/uploadify/uploadify.swf',
		        'script'    : 'js/uploadify/uploadify.php',
		        'cancelImg' : 'js/uploadify/cancel.png',
		        'folder'    : '1',
		        'auto'      : true,
		        'fileExt'   : '*.pdf;*.txt;',
		        'fileDesc'  : 'Web Image Files (.PDF,*.txt)',
		        'sizeLimit' : '8697152',
		        'onComplete'  : function(event, ID, fileObj, response, data) {
		          $("#" + $(event.target).attr("id")).nextAll(".del_file").show();
		          $("#" + $(event.target).attr("id")).nextAll(".file_src").val(response);
		          $("#" + $(event.target).attr("id")).nextAll(".file_link").attr("href","../"+response);
		          $("#" + $(event.target).attr("id")).nextAll(".file_link").show();
		        }		        
			});
		});
    });	
    
    $(".del_file").click(
        function()
        {
          if(confirm("您确认要删除该附件么？"))
          {
            $(this).hide();
            $(this).nextAll(".file_src").val("");
            $(this).nextAll(".file_link").attr("href","");
            $(this).nextAll(".file_link").hide();
            alert("附件已成功删除");
          }
        }
    )
</script>
</body>

</html>

